import axios from '../../util/http'

const order = {
  state:{
    orderList:null,

  },
  mutations:{
    SET_orderList:(state,data)=>{
      state.orderList = data
    }
  },
  actions:{
    queryGetOrderList:({commit, rootState},params)=>{
      let {openId,limit,page} = params
      return new Promise((resolve,reject)=>{
        axios.post(rootState.orderList,params).then(res=>{
            console.log(res.data)
          let filterValue = ['F','R','A']
          let orderList = res.data.page.list.filter(v=>!filterValue.includes(v.txtSts))
          console.log(orderList)
          commit('SET_orderList',orderList)
          resolve(res.data.list)
        }).catch(e=>{
          reject(e)
        })
      })

    }
  }
}

export default order
